/******************************************************************************* 
 * Copyright (C) 2012-2015 Microfountain Technology, Inc. All Rights Reserved. 
 * 
 * Unauthorized copying of this file, via any medium is strictly prohibited.   
 * Proprietary and confidential
 * 
 * Last Modified: 2015-11-25 9:18:14
 ******************************************************************************/
package cn.com.xy.sms.sdk.dex;

import java.io.File;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/*SDK-640 hewengao 20161012 start*/
import java.util.concurrent.ConcurrentHashMap;

import org.json.JSONArray;
import org.json.JSONObject;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Process;
import cn.com.xy.sms.sdk.Iservice.CorpSignInterface;
import cn.com.xy.sms.sdk.Iservice.IActionService;
import cn.com.xy.sms.sdk.Iservice.OnlineParseInterface;
import cn.com.xy.sms.sdk.Iservice.OnlineUpdateCycleConfigInterface;
import cn.com.xy.sms.sdk.Iservice.OnlineViewInterface;
import cn.com.xy.sms.sdk.Iservice.ParseBoxInterface;
import cn.com.xy.sms.sdk.Iservice.ParseBubbleInterface;
import cn.com.xy.sms.sdk.Iservice.ParseCardInterface;
import cn.com.xy.sms.sdk.Iservice.ParseContactInterface;
import cn.com.xy.sms.sdk.Iservice.ParseDateInterface;
import cn.com.xy.sms.sdk.Iservice.ParseNotificationInterface;
import cn.com.xy.sms.sdk.Iservice.ParsePayInterface;
import cn.com.xy.sms.sdk.Iservice.ParseRemindInterface;
import cn.com.xy.sms.sdk.Iservice.ParseVerifyCodeInterface;
import cn.com.xy.sms.sdk.Iservice.ParseVerifyCodeValidTimeInterfaceget;
import cn.com.xy.sms.sdk.Iservice.ParseWatchInterface;
import cn.com.xy.sms.sdk.Iservice.XyCallBack;
import cn.com.xy.sms.sdk.action.AbsSdkDoAction;
/*SDK-481 hewengao 20160613 end */
import cn.com.xy.sms.sdk.constant.Constant;
/* SDK-428 huangzhiqiang 20160603 end */
import cn.com.xy.sms.sdk.db.ParseItemManager;
import cn.com.xy.sms.sdk.db.entity.JarSubInfoManager;
import cn.com.xy.sms.sdk.db.entity.SysParamEntityManager;
import cn.com.xy.sms.sdk.log.LogManager;
import cn.com.xy.sms.sdk.net.NetUtil;
import cn.com.xy.sms.sdk.net.util.SigntureUtil;
/*SDK-431 songzhirong 20160530 end*/
/* SDK-428 huangzhiqiang 20160603 start */
import cn.com.xy.sms.sdk.number.ChannelType;
import cn.com.xy.sms.sdk.queue.SdkTaskQueue;
import cn.com.xy.sms.sdk.queue.TaskInfo;
/*SDK-616 hewengao 20160912 start*/
import cn.com.xy.sms.sdk.threadpool.SmartSmsThreadPoolManager;
/*SDK-431 songzhirong 20160530 start*/
import cn.com.xy.sms.sdk.util.ConversationManager;
import cn.com.xy.sms.sdk.util.CorpSignUtils;
/*SDK-481 hewengao 20160613 start */
import cn.com.xy.sms.sdk.util.DuoquUtils;
import cn.com.xy.sms.sdk.util.FileUtils;
/*SDK-640 hewengao 20161012 end*/
 /*SDK-673 hewengao 20161114 start*/
import cn.com.xy.sms.sdk.util.InitUtil;
import cn.com.xy.sms.sdk.util.JarSubCheckQueue;
import cn.com.xy.sms.sdk.util.JsonUtil;
import cn.com.xy.sms.sdk.util.KeyManager;
import cn.com.xy.sms.sdk.util.PopupUtil;
import cn.com.xy.sms.sdk.util.RecordFunctionUtil;
import cn.com.xy.sms.sdk.util.StringUtils;
import cn.com.xy.sms.sdk.util.XyUtil;
import cn.com.xy.sms.util.UUIDUtils;
import dalvik.system.DexClassLoader;
/*SDK-673 hewengao 20161114 end*/
@SuppressLint("NewApi")
public class DexUtil {

    private static final String TAG = "DexUtil";
    private static ClassLoader mDexClassLoader;
    private static OnlineParseInterface mOnlineParseImpl;
    private static OnlineUpdateCycleConfigInterface mOnlineUpdateCycleConfig;
    private static ParseVerifyCodeValidTimeInterfaceget mParseVerifyCodeValidTime;
    /*SDK-640 hewengao 20161012 start*/
    private static Map<String, ClassLoader> mClassLoaderMap = new ConcurrentHashMap<String, ClassLoader>();
    private static Map<String, Class> mClassMap = new ConcurrentHashMap<String, Class>();
    /*SDK-640 hewengao 20161012 end*/
//    public static ExecutorService pool = Executors.newFixedThreadPool(1);
    /* SDK-453/yangzhi/2016.05.23---start--- */
    private static String uiVersion = "";// ui版本号
    /* SDK-453/yangzhi/2016.05.23---end--- */
    
    public static void init() {
        try {
            final File dexInternalStoragePath = new File(Constant.getJarPath());
            if (dexInternalStoragePath.exists()) {

                if (/* SigntureUtil.verifySignature(Constant.getContext()) */SigntureUtil.getSignResult(Constant.getJarPath())) {
                    mDexClassLoader = getDexClassLoader(true);
                    // OnlineViewImpl = getOnlineViewImpl(true);
                    mOnlineParseImpl = getOnlineParseImpl(true);
                    if (LogManager.debug) {
                        LogManager.i("DexUtil", "验证通过");
                    }

                } else {
                    if (LogManager.debug) {
                        LogManager.i("DexUtil", "验证不通过");
                    }
                }
                
            }

        } catch (Throwable e) {
            LogManager.e("DexUtil", e.getMessage(),e);
        }

    }

    /**
     * 初始化OnlineUpdateCycleConfig对象
     * 
     */
    public static void initOnlineUpdateCycleConfig() {
        mOnlineUpdateCycleConfig = getOnlineUpdateCycleConfig();
        /* SDK-517 huangzhiqiang 20160701 start */
        setOnlineUpdateCycleConfigInstance(null);
        /* SDK-517 huangzhiqiang 20160701 end */
    }
    
    public static void  initParseVerifyCodeValidTime() {
        mParseVerifyCodeValidTime = getParseVerifyCodeValidTime();
    }

    /* SDK-657 zhaojiangwei 20161101 start */
    public synchronized static ClassLoader getDexClassLoader() {
    /* SDK-657 zhaojiangwei 20161101 end */	
        try {
            if (mDexClassLoader == null) {
                final File dexInternalStoragePath = new File(Constant.getJarPath());
                if (dexInternalStoragePath.exists()) {
                    if (/* SigntureUtil.verifySignature(Constant.getContext()) */SigntureUtil.getSignResult(Constant.getJarPath())) {
                        final File optimizedDexOutputPath = Constant.getContext().getDir("outdex", Context.MODE_PRIVATE);
                        mDexClassLoader = new DexClassLoader(dexInternalStoragePath.getCanonicalPath(), optimizedDexOutputPath.getCanonicalPath(), null, Constant.getContext().getClassLoader());
                        XyUtil.chmod("640", optimizedDexOutputPath.getCanonicalPath() + File.separator + dexInternalStoragePath.getName().substring(0, dexInternalStoragePath.getName().length() - 4) + ".dex");
                    }
                }
            }

        } catch (Throwable e) {
//            e.printStackTrace();
            LogManager.e("DexUtil", e.getMessage(),e);
        }
        return mDexClassLoader;
    }
    /* SDK-657 zhaojiangwei 20161101 start */
    public synchronized static ClassLoader getDexClassLoader(boolean reload) {
    /* SDK-657 zhaojiangwei 20161101 end */
        try {
            if (mDexClassLoader == null || reload) {
                final File dexInternalStoragePath = new File(Constant.getJarPath());
                if (dexInternalStoragePath.exists()) {
                    if (/* SigntureUtil.verifySignature(Constant.getContext()) */SigntureUtil.getSignResult(Constant.getJarPath())) {
                        final File optimizedDexOutputPath = Constant.getContext().getDir("outdex", Context.MODE_PRIVATE);
                        mDexClassLoader = new DexClassLoader(dexInternalStoragePath.getCanonicalPath(), optimizedDexOutputPath.getCanonicalPath(), null, Constant.getContext().getClassLoader());
                    }
                }
            }

        } catch (Throwable e) {
            LogManager.e("DexUtil", e.getMessage(),e);
        }
        return mDexClassLoader;
    }

    public static void removeClassLoaderBySubname(String subname) {
        try {
            LogManager.d("JarSubInfo", "removeClassLoaderBySubname subname=", subname);
            mClassLoaderMap.remove(subname + "_ClassLoader");
            mClassMap.remove(subname + "_Class");
        } catch (Throwable e) {
            LogManager.d("DexUtil", e.getMessage());
        }
    }

    public static ClassLoader getClassLoaderBymap(Map<String, String> map, final String subname, boolean reload) {
        try {
        	/*SDK-667 zhaojiangwei 20161108 start*/
            //ClassLoader classLoader = mClassLoaderMap.get(subname + "_ClassLoader");
            ClassLoader classLoader = null;
            if(!reload) {
                classLoader = mClassLoaderMap.get(subname + "_ClassLoader");
            }
            /*SDK-667 zhaojiangwei 20161108 end*/
            if (classLoader != null) {
                return classLoader;
            } else {
                String jarPath = FileUtils.getFilePath(Constant.getPARSE_PATH(), subname + "_", ".jar");
                final File dexInternalStoragePath = new File(jarPath);
                if (dexInternalStoragePath.exists() && SigntureUtil.getSignResult(jarPath)) {

                    // Internal storage where the DexClassLoader writes the
                    // optimized dex file to.
                    final File optimizedDexOutputPath = Constant.getContext().getDir("outdex", Context.MODE_PRIVATE);
                        // Initialize the class loader with the secondary dex file.
                          /*SDK-654 hewengao 20161019 start*/
                         ClassLoader tempParentLoader = getDexClassLoader();
                        if(tempParentLoader != null) {
                            classLoader = new DexClassLoader(dexInternalStoragePath.getCanonicalPath(), optimizedDexOutputPath.getCanonicalPath(), null, tempParentLoader);
                        }
                      //XyUtil.chmod("640", optimizedDexOutputPath.getCanonicalPath() + File.separator + dexInternalStoragePath.getName().substring(0, dexInternalStoragePath.getName().length() - 4) + ".dex");
                        /*SDK-654 hewengao 20161019 end*/
                    if (classLoader != null) {
                        mClassLoaderMap.put(subname + "_ClassLoader", classLoader);
                        return classLoader;
                    }

                }

            }
        } catch (Throwable e) {
            LogManager.e("DexUtil", e.getMessage(),e);
            /* SDK-584 zhaojiangwei 20160906 start */
            DexUtil.saveExceptionLog(e);
            /* SDK-584 zhaojiangwei 20160906 end */
        } finally {
            try {
                /*SDK-616 hewengao 20160912 start*/
                SmartSmsThreadPoolManager.iccidPool.execute(new Runnable() {
                /*SDK-616 hewengao 20160912 end*/
                    @Override
                    public void run() {
                        try {
                              /*SDK-426 hewengao 20160506 start */
                            android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
                            Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
                            /*SDK-627 hewengao/20160929 start*/
                            Thread.currentThread().setName("xiaoyuan-ipool"+Thread.currentThread().hashCode());
                            /*SDK-627 hewengao/20160929 end*/
                              /*SDK-426 hewengao 20160506 end */
                            if (subname != null && subname.length() > 7) {
                                long time = 0;
                                Long cacheTime = Constant.checkJarMap.get(subname);
                                if (cacheTime != null) {
                                    time = cacheTime;
                                }
                                long addTaskForTime = Constant.addTaskForTime;
                                // mOnlineUpdateCycleConfig不为null时才调用getUpdateCycleByType，防止死循环
                                if (mOnlineUpdateCycleConfig != null) {
                                    addTaskForTime = DexUtil.getUpdateCycleByType(OnlineUpdateCycleConfigInterface.TYPE_JAR_UPDATE_CYCLE, Constant.addTaskForTime);
                                }
                                if (System.currentTimeMillis() >= (time + addTaskForTime)) {
                                    JarSubInfoManager.insertOrUpdateJarSubInfo(subname, "-1", JarSubInfoManager.USED);
                                    Constant.checkJarMap.put(subname, System.currentTimeMillis());
                                    JarSubCheckQueue.runJarSubCheckQueue();
                                }
                            }
                        } catch (Exception e) {
                            LogManager.e(Constant.TAG, "getClassLoaderBymap: ", e);
                            /* SDK-584 zhaojiangwei 20160906 start */
                            DexUtil.saveExceptionLog(e);
                            /* SDK-584 zhaojiangwei 20160906 end */
                        }
                    }
                });
            
            } catch (Throwable e) {
                LogManager.e(Constant.TAG, "getClassLoaderBymap: ", e);

            }
        }
        return null;
    }
    
    /*SDK-667 zhaojiangwei 20161108 start*/
    public static Class getClassBymap(Map<String, String> map, String className) {
        return getClassBymap(map,className,false);
    }
    /*SDK-667 zhaojiangwei 20161108 end*/
    
    public static Class getClassBymap(Map<String, String> map, String className, boolean reLoad) {
        String subname = null;
        try {
            subname = className.substring(className.lastIndexOf(".") + 1);
            ClassLoader classLoader = getClassLoaderBymap(map, subname, reLoad);
            if (classLoader != null) {
            	/*MEIZU-1783 songzhirong 20161213 start*/
            	Class classInstane = null;
            	if(reLoad){
            		classInstane = classLoader.loadClass(className);
                    if (classInstane != null) {
                        mClassMap.put(subname + "_Class", classInstane);
                        return classInstane;
                    }
            	}
                classInstane = mClassMap.get(subname + "_Class");
            	/*MEIZU-1783 songzhirong 20161213 end*/
                if (classInstane != null) {
                    return classInstane;
                } else {
                    classInstane = classLoader.loadClass(className);
                    if (classInstane != null) {
                        mClassMap.put(subname + "_Class", classInstane);

                        return classInstane;
                    }
                }
            }
        } catch (Throwable e) {
            /*SDK-667 hewengao 20161107 start*/
            removeClassLoaderBySubname(subname);
            /*SDK-667 hewengao 20161107 end*/

            /*SDK-699 wangxingjian 20161208 start*/
             /*SDK-674 hewengao 20161114 start*/
            /*MEIZU-2258 songzhirong 20170322 start */
//            DuoquUtils.getSdkDoAction().logInfo(Constant.TAG," error getClassBymap not find className:"+className,null);
            /*MEIZU-2258 songzhirong 20170322 start */
            LogManager.w(Constant.TAG," error getClassBymap not find className:"+className,null);
             /*SDK-674 hewengao 20161114 end*/
            /*SDK-699 wangxingjian 20161208 end*/
            
            LogManager.e("DexUtil", e.getMessage());
            /* SDK-584 zhaojiangwei 20160906 start */
            DexUtil.saveExceptionLog(e);
            /* SDK-584 zhaojiangwei 20160906 end */
        }
        /*SDK-699 wangxingjian 20161208 start*/
         /*SDK-674 hewengao 20161114 start*/
        LogManager.w(Constant.TAG,"getClassBymap not find className:"+className,null);
         /*SDK-674 hewengao 20161114 end*/
        /*SDK-699 wangxingjian 20161208 end*/
        return null;
    }

    /**
     * 是否是应用渠道
     * 
     * @return
     */
    public static boolean isAppChannel(String appKey) {
        return true;
//        if (DuoquUtils.getAidlAction().supportAidlAction()) {
//            return DuoquUtils.getAidlAction().isAppChannel(appKey);
//        }
//        boolean opRet = false;
//        if (StringUtils.isNull(appKey)) {
//            return opRet;
//        }
//        try {
//            OnlineParseInterface lib = DexUtil.getOnlineParseImpl(false);
//            if (lib != null) {
//                opRet = lib.isAppChannel(appKey);
//            }
//        }
//        catch (Throwable e) {
//            LogManager.e(Constant.TAG, "isAppChannel: ", e);
//        }
//        return opRet;
    }
    
    /* SDK-657 zhaojiangwei 20161101 start */
    public synchronized static OnlineParseInterface getOnlineParseImpl(boolean reload) {
    /* SDK-657 zhaojiangwei 20161101 end */
        try {
            if (mOnlineParseImpl == null || reload) {
                ClassLoader dexClassLoader = getDexClassLoader();
                if (dexClassLoader != null) {

                    Class onlineParseImplClass = dexClassLoader.loadClass("cn.com.xy.sms.sdk.Iservice.OnlineParseImpl");
                    if (onlineParseImplClass != null) {
                        mOnlineParseImpl = (OnlineParseInterface) onlineParseImplClass.newInstance();
                    }

                }

            }
        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "getOnlineParseImpl: ", e);

        }
        return mOnlineParseImpl;
    }

    public static OnlineViewInterface getOnlineViewImpl(boolean reload) {
        OnlineViewInterface onlineViewImpl = null;
        try {
            Class onlineViewImplClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.OnlineViewImpl");
            if (onlineViewImplClass != null) {
                onlineViewImpl = (OnlineViewInterface) onlineViewImplClass.newInstance();
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "getOnlineViewImpl: ", e);
        }
        return onlineViewImpl;
    }

    public static ParseCardInterface getParseCardImpl(boolean reload) {
        ParseCardInterface parseUtilCard = null;
        try {
            Class parseUtilCardClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilCard");
            if (parseUtilCardClass != null) {
                parseUtilCard = (ParseCardInterface) parseUtilCardClass.newInstance();
                if(parseUtilCard != null){
                     SdkTaskQueue.addTask(new TaskInfo(12, "state",  String.valueOf(RecordFunctionUtil.CARD_STATE)));//卡夹的状态标记
                }
            }

        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "getParseCardImpl: ", e);


        }
        return parseUtilCard;

    }

    public static ParsePayInterface getParsePayImpl(boolean reload) {
        ParsePayInterface parseUtilPay = null;
        try {
            Class parseUtilPayClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilPay");
            if (parseUtilPayClass != null) {
                parseUtilPay = (ParsePayInterface) parseUtilPayClass.newInstance();
            }

        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "getParsePayImpl: ", e);


        }
        return parseUtilPay;

    }

    public static ParseRemindInterface getParseRemindImpl(boolean reload) {
        ParseRemindInterface parseRemind = null;
        try {
            Class parseRemindClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseRemind");
            if (parseRemindClass != null) {
                parseRemind = (ParseRemindInterface) parseRemindClass.newInstance();
            }

        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "getParseRemindImpl: ", e);


        }
        return parseRemind;

    }

    public static ParseNotificationInterface getParseNotificationImpl(boolean reload) {
        ParseNotificationInterface parseNotification = null;
        try {
            Class parseNotificationClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseNotification");
            if (parseNotificationClass != null) {
                parseNotification = (ParseNotificationInterface) parseNotificationClass.newInstance();
            }
        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "getParseNotificationImpl: ", e);


        }
        return parseNotification;

    }

    public static ParseDateInterface getParseDateImpl(boolean reload) {
        ParseDateInterface parseDate = null;
        try {
            Class parseDateClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseDate");
            if (parseDateClass != null) {
                parseDate = (ParseDateInterface) parseDateClass.newInstance();
            }

        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "getParseDateImpl: ", e);

        }
        return parseDate;

    }
    /*SDK-654 hewengao 20161026 start*/
    static android.util.LruCache<String,Map<String, Object>> mCacheParseResult = new android.util.LruCache<String,Map<String, Object>>(12);
    static long mLastParseTime= 0;
    /*SDK-654 hewengao 20161026 end*/
    public static Map<String, Object> parseMsgToMap(String sender, String content, Map<String, String> map) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().parseMsgToBaseMap(sender, content, map);
        }
        Map<String, Object> valueMap = null;
        try {
            OnlineParseInterface lib = null;
              /*SDK-654 hewengao 20161026 start*/
            final String cacheKey =StringUtils.getMD5(sender+content);
            Map<String, Object> res =  mCacheParseResult.get(cacheKey);
            if(res != null){
                HashMap<String,Object> data = new HashMap<String,Object>();
                data.putAll(res);
                /*SDK-622 hewengao 20161101 start*/
                data.put("from_cache","");
                /*SDK-622 hewengao 20161101 end*/
                return data;
            }
            if(System.currentTimeMillis() - mLastParseTime > 30000){
                mCacheParseResult.evictAll();
            }
              /*SDK-654 hewengao 20161026 end*/
            lib = DexUtil.getOnlineParseImpl(false);

            if (lib != null) {
                valueMap = lib.parseMessage(sender, content, map);
                /*SDK-654 hewengao 20161026 start*/
                mLastParseTime = System.currentTimeMillis();
                if(valueMap != null && valueMap.size() > 2) {
                    HashMap<String,Object> data = new HashMap<String,Object>();
                    data.putAll(valueMap);
                    mCacheParseResult.put(cacheKey, data);
                }
                /*SDK-654 hewengao 20161026 end*/
            }
        } catch (Throwable e) {
            LogManager.w("DexUtil", e.getMessage(),e);
        }
        return valueMap;
    }
    
    /**
     * 兜底验证码优先识别
     * 
     * @param sender
     * @param content
     * @param map
     * @return
     */
    public static Map<String, Object> parseVerifyCodeToMap(String sender, String content, Map<String, String> map) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().parseVerifyCodeToMap(sender, content, map);
        }
        Map<String, Object> valueMap = null;
        try {
            OnlineParseInterface lib = DexUtil.getOnlineParseImpl(false);
            if (lib != null) {
                valueMap = lib.parseVerCode(sender, content, map);
            }
        } catch (Throwable e) {
            LogManager.w("DexUtil", e.getMessage(),e);
        }
        return valueMap;
    }

    public static String getSuanfaVersion() {
        OnlineParseInterface lib = null;
        String channelName = null;
        try {
            channelName = SysParamEntityManager.getStringParam(Constant.getContext(), Constant.CHANNEL);
            lib = DexUtil.getOnlineParseImpl(false);
            if (lib != null) {
                String suanfaVersion = lib.getReqVersion(channelName);
                if (!StringUtils.isNull(suanfaVersion)) {
                    return suanfaVersion;
                }
            }
        } catch (Throwable e) {
            LogManager.e("DexUtil getSuanfaVersion", "获取算法包内的版本号出现异常");
        }
        // 无法获取算法包内的算法包版本号时，使用默认方案获取算法包版本号，除联想渠道算法包版本号为20150619外，其它渠道都使用20150202
        if ("VMhlWdEwVNEW_LENOVO".equals(channelName)) {
            return "20150619";
        }
        return Constant.suanfa_version;
    }

    public static Map<String, Object> handerValueMap(Map<String, Object> valueMap, String titleNo) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().handerValueMap(valueMap, titleNo);
        }
        Map<String, Object> newValueMap = null;
        /*SDK-431 songzhirong 20160530 start*/
        String uuid = UUIDUtils.uniqId();
        JSONObject jsonObject = null;
        try {
            jsonObject = JsonUtil.changeMapToJason(valueMap);
            ConversationManager.saveLogIn(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "handerValueMap", jsonObject,titleNo);
            /*SDK-431 songzhirong 20160530 end*/    
            OnlineViewInterface lib = DexUtil.getOnlineViewImpl(false);
            if (lib != null) {
                LogManager.d("showPopuMessage", "OnlineViewInterface is not null");
                newValueMap = lib.handerValueMap(valueMap, titleNo);
            } else {
                LogManager.d("showPopuMessage", "OnlineViewInterface is null");
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "handerValueMap erro: ", e);
        }finally{
            /*SDK-431 songzhirong 20160530 start*/
            ConversationManager.saveLogOut(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "handerValueMap", jsonObject,titleNo,JsonUtil.changeMapToJason(newValueMap));
            /*SDK-431 songzhirong 20160530 end*/
        }
        return newValueMap;
    }

    public static Map<String, Object> handerValueMap(Map<String, Object> valueMap) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().handerValueMap(valueMap);
        }
        Map<String, Object> newValueMap = null;
        /*SDK-431 songzhirong 20160530 start*/
        String uuid = UUIDUtils.uniqId();
        JSONObject jsonObject = null;
        try {
            jsonObject = JsonUtil.changeMapToJason(valueMap);
            ConversationManager.saveLogIn(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "handerValueMap", jsonObject);
            /*SDK-431 songzhirong 20160530 end*/
            ParseCardInterface lib = DexUtil.getParseCardImpl(false);
            if (lib != null) {
                LogManager.d("showPopuMessage", "ParseCardInterface is not null");
                newValueMap = lib.handerValueMap(valueMap);
            }
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "handerValueMap error: ", e);
        }finally{
            /*SDK-431 songzhirong 20160530 start*/
            ConversationManager.saveLogOut(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "handerValueMap", jsonObject,JsonUtil.changeMapToJason(newValueMap));
            /*SDK-431 songzhirong 20160530 end*/
        }
        return newValueMap;
    }

    public static Map<String, Object> handerPayValueMap(Map<String, Object> valueMap) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().handerPayValueMap(valueMap);
        }
        Map<String, Object> newValueMap = null;
        try {
            ParsePayInterface lib = DexUtil.getParsePayImpl(false);
            if (lib != null) {
                LogManager.d("showPopuMessage", "ParsePayInterface is not null");
                newValueMap = lib.handerValueMap(valueMap);
            }
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "handerPayValueMap error: ", e);
        }
        return newValueMap;

    }

    public static Map<String, Object> handerRemindValueMap(Map<String, Object> valueMap) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().handerRemindValueMap(valueMap);
        }
        Map<String, Object> newValueMap = null;
        try {
            ParseRemindInterface lib = DexUtil.getParseRemindImpl(false);
            if (lib != null) {
                LogManager.d("showPopuMessage", "ParseRemindInterface is not null");
                LogManager.d("showPopuMessage", valueMap.toString());
                newValueMap = lib.handerValueMap(valueMap);
            } else {
                LogManager.d("showPopuMessage", "ParseRemindInterface is null");
            }
        }
        catch (Throwable e) {
            LogManager.w(Constant.TAG, "handerRemindValueMap error ", e);
        }
        return newValueMap;
    }

    public static Map<String, Object> handerDateValueMap(Map<String, Object> valueMap) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().handerDateValueMap(valueMap);
        }
        Map<String, Object> newValueMap = null;
        try {
            ParseDateInterface lib = DexUtil.getParseDateImpl(false);
            if (lib != null) {
                newValueMap = lib.handerValueMap(valueMap);
            } else {
                LogManager.d("showPopuMessage", "ParseDateInterface is null");
            }
        } 
        catch (Throwable e) {
            LogManager.e(Constant.TAG, "handerDateValueMap: " + e.getMessage(), e);
        }
        return newValueMap;

    }

    public static Map<String, Object> handerNotificationValueMap(Map<String, Object> valueMap) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().handerNotificationValueMap(valueMap);
        }
        Map<String, Object> newValueMap = null;
        /*SDK-431 songzhirong 20160530 start*/
        String uuid = UUIDUtils.uniqId();
        JSONObject jsonObject = null;
        try {
            jsonObject = JsonUtil.changeMapToJason(valueMap);          
            ConversationManager.saveLogIn(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "handerNotificationValueMap",  jsonObject);
            /*SDK-431 songzhirong 20160530 end*/
            ParseNotificationInterface lib = DexUtil.getParseNotificationImpl(false);
            if (lib != null) {
                LogManager.d("showPopuMessage", "ParseDateInterface is not null");
                LogManager.d("showPopuMessage", valueMap.toString());
                newValueMap = lib.handerValueMap(valueMap);
                if(newValueMap != null){
                     SdkTaskQueue.addTask(new TaskInfo(12, "state",  String.valueOf(RecordFunctionUtil.NOTIFY_STATE)));//通知栏状态标记
                }
            } else {
                LogManager.d("showPopuMessage", "ParseDateInterface is null");
            }
        } catch (Throwable e) {

//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "handerNotificationValueMap: error ", e);

        }finally{
            /*SDK-431 songzhirong 20160530 start*/
            ConversationManager.saveLogOut(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "handerNotificationValueMap",  jsonObject,JsonUtil.changeMapToJason(newValueMap));
            /*SDK-431 songzhirong 20160530 end*/
        }
        return newValueMap;

    }

    public static Map<String, Object> handerBubbleValueMap(Map<String, Object> valueMap) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().handerBubbleValueMap(valueMap);
        }
        Map<String, Object> newValueMap = null;
        /*SDK-431 songzhirong 20160530 start*/
        JSONObject jsonObject = null;
        String uuid = UUIDUtils.uniqId();
        try {
            jsonObject = JsonUtil.changeMapToJason(valueMap); 
            ConversationManager.saveLogIn(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "handerBubbleValueMap",  jsonObject);
            /*SDK-431 songzhirong 20160530 end*/
            Class parseUtilBubbleClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilBubble");
            if (parseUtilBubbleClass != null) {
                ParseBubbleInterface parseUtilBubble = (ParseBubbleInterface) parseUtilBubbleClass.newInstance();
                if (parseUtilBubble != null) {
                    newValueMap = parseUtilBubble.handerValueMap(valueMap);
                    if (newValueMap != null){
                        SdkTaskQueue.addTask(new TaskInfo(12, "state",  String.valueOf(RecordFunctionUtil.RICH_BUBBLE_STATE)));//丰富气泡功能标记状态
                    }
                }
            }
            
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "handerBubbleValueMap error" , e);
        }finally{
            /*SDK-431 songzhirong 20160530 start*/
            ConversationManager.saveLogOut(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "handerBubbleValueMap",  jsonObject,JsonUtil.changeMapToJason(newValueMap));
            /*SDK-431 songzhirong 20160530 end*/
        }
        return newValueMap;

    }
    
    /**
     * 根据号码判断是否运营商号码
     * @param phone
     * @return
     */
    public static Boolean isOperatorsPhoneType(String phone) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().isOperatorsPhoneType(phone);
        }
        Boolean isOperators = false;
        try {
            Class parseUtilCardClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilCard");
            if (parseUtilCardClass != null) {
                Method method = parseUtilCardClass.getMethod("isOperatorsPhone", String.class);
                isOperators = (Boolean) method.invoke(parseUtilCardClass, phone);
                return isOperators;
            }
        }
        catch (Throwable e) {
            LogManager.w(Constant.TAG, "ParseUtilCard error:", e);
        }
        return isOperators;
    }

    public static String getBubbleViewVersion(Map<String, Object> extend) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getBubbleViewVersion(extend);
        }
        String version = null;
        try {
            Class parseUtilBubbleClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilBubble");
            if (parseUtilBubbleClass != null) {
                ParseBubbleInterface parseUtilBubble = (ParseBubbleInterface) parseUtilBubbleClass.newInstance();
                if (parseUtilBubble != null) {
                    version = parseUtilBubble.getBubbleViewVersion(extend);
                }
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "getBubbleViewVersion error ", e);
        }
        /* SDK-398 huangzhiqiang 20160418 start */
        return version == null ? "" : version;
        /* SDK-398 huangzhiqiang 20160418 end */
    }

    public static boolean isEnterpriseSms(Context ctx, String phoneNumber, String smsContent, Map<String, String> extend) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().isEnterpriseSms(phoneNumber, smsContent, extend);
        }
        OnlineParseInterface lib = null;
        boolean result = false;
        try {

            lib = DexUtil.getOnlineParseImpl(false);
            if (lib != null) {
                result = lib.isEnterpriseSms(ctx, phoneNumber, smsContent, extend);
            }
            else {
                result = PopupUtil.isEnterpriseSms(ctx, phoneNumber, smsContent, extend);
            }
        }
        catch (Throwable e) {
            result = PopupUtil.isEnterpriseSms(ctx, phoneNumber, smsContent, extend);
            return result;
        }
        return result;
    }

    public static int getActionCode(String action) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getActionCode(action);
        }
        int type = -1;
        OnlineParseInterface lib = null;
        try {

            lib = DexUtil.getOnlineParseImpl(false);

            if (lib != null) {
                type = lib.getActionCode(action);
            } else {
                type = PopupUtil.getActionCode(action);
            }

        } catch (Throwable e) {
            LogManager.w("DexUtil", e.getMessage(),e);
            type = PopupUtil.getActionCode(action);
            return type;
        }
        return type;
    }

    public static String[] parseMsgToNewContacts(String phonenum, String msg, String oldContact, String[] contactNames) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().parseMsgToNewContacts(phonenum, msg, oldContact, contactNames);
        }
        String[] result = null;
        OnlineParseInterface lib = null;
        try {
            lib = DexUtil.getOnlineParseImpl(false);
            if (lib != null) {
                result = lib.parseMsgToNewContacts(phonenum, msg, oldContact, contactNames);
            }
        } catch (Throwable e) {
            // e.printStackTrace();
            return result;
        }
        return result;
    }

    /**
     * 根据识别结果map，获取短信类型
     * 
     * @param resultMap
     * @param juagetype
     * @return
     */
    public static int getSmsTypeByMap(Map<String, Object> resultMap, int juagetype) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getSmsTypeByMap(resultMap, juagetype);
        }
        int result = -1;
        try {
            OnlineParseInterface lib = DexUtil.getOnlineParseImpl(false);
            if (lib != null) {
                result = lib.getSmsTypeByMap(resultMap, juagetype);
            }
        } catch (Throwable e) {
            // e.printStackTrace();
            return result;

        }
        return result;
    }

    /**
     * 是否启用服务选择页
     * 
     * @param channel
     *            客户端渠道号
     * @param type
     *            动作类型
     * @return
     */
    public static int isServiceChoose(String channel, String type) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().isServiceChoose(channel, type);
        }
        int result = -1;
        OnlineParseInterface lib = null;
        try {
            lib = DexUtil.getOnlineParseImpl(false);
            if (lib != null) {
                result = lib.isServiceChoose(channel, type);
            }
        } catch (Throwable e) {
            // TODO: handle exception
            return -2;
        }
        return result;
    }

    /**
     * 获取情景资源版本号
     * 
     * @return
     */
    public static String getSceneVersion() {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getSceneVersion();
        }
        String channel = null;
        try {
            // 获取算法包内的资源版本号
            channel = SysParamEntityManager.getStringParam(Constant.getContext(), Constant.CHANNEL);
            OnlineParseInterface lib = DexUtil.getOnlineParseImpl(false);
            if (lib != null) {
                String sceneVersion = lib.getSceneVersion(channel);
                if (!StringUtils.isNull(sceneVersion)) {
                    return sceneVersion;
                }
            }
        } catch (Throwable e) {
            LogManager.w("DexUtil", "getSceneVersion获取算法包内的资源版本号出现异常",e);
        }

        // 无法获取算法包内的资源版本号时，使用默认方案获取资源版本号，除联想渠道资源版本号为20150619外，其它渠道都使用20140815
        if ("VMhlWdEwVNEW_LENOVO".equals(channel)) {
            return "20150619";
        }
        return "20140815";
    }

    public static Map<String, Object> handerValueMapByType(int type, Map<String, Object> valueMap) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().handerValueMapByType(type, valueMap);
        }
        Map<String, Object> newValueMap = null;
        try {
            Class parseVerifyCodeClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseVerifyCode");
            if (parseVerifyCodeClass != null) {
                ParseVerifyCodeInterface parseVerifyCode = (ParseVerifyCodeInterface) parseVerifyCodeClass.newInstance();
                if (parseVerifyCode != null) {
                    newValueMap = parseVerifyCode.handerValueMapByType(type, valueMap);
                }
            }
        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "handerValueMapByType error: ", e);
        }
        return newValueMap;
    }

    /**
     * 根据类型获取更新周期
     * 
     * @param type
     *            类型
     * @param defaultValue
     *            默认值，无法获取数据时返回该值
     * @return
     */
    /* SDK-657 zhaojiangwei 20161101 start */
    public synchronized static long getUpdateCycleByType(int type, long defaultValue) {
    /* SDK-657 zhaojiangwei 20161101 end */
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getUpdateCycle(type, defaultValue);
        }
        try {
            if (mOnlineUpdateCycleConfig == null) {
                mOnlineUpdateCycleConfig = getOnlineUpdateCycleConfig();
            }
            if (mOnlineUpdateCycleConfig != null) {
                return mOnlineUpdateCycleConfig.getUpdateCycle(type, defaultValue);
            }
        } catch (Throwable t) {
            LogManager.w("xiaoyuan", "DexUtil getUpdateCycleByType：", t);
        }
        return defaultValue;
    }
    
    /**
     * 获取验证码有效时间
     * 
     * @param valueMap key:validTime
     * @return
     */
    /* SDK-657 zhaojiangwei 20161101 start */
    public synchronized static Map<String, Object> handleValidTime(Map<String, Object> valueMap){
    /* SDK-657 zhaojiangwei 20161101 end */
        if (valueMap == null) {
            return null;
        }
        try {
            if (mParseVerifyCodeValidTime == null) {
                mParseVerifyCodeValidTime = getParseVerifyCodeValidTime();
            }
            if (mParseVerifyCodeValidTime != null) {
                return mParseVerifyCodeValidTime.handleValidTime(valueMap);
            }
        } catch (Throwable t) {
            LogManager.w("xiaoyuan", "DexUtil handleValidTime error", t);
        }
        return null;
    }

    /**
     * 反射获取OnlineUpdateCycleConfig对象
     * 
     * @return
     */
    private static OnlineUpdateCycleConfigInterface getOnlineUpdateCycleConfig() {
        try {
            Class onlineUpdateCycleConfigClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.OnlineUpdateCycleConfig");
            if (onlineUpdateCycleConfigClass != null) {
                mOnlineUpdateCycleConfig = (OnlineUpdateCycleConfigInterface) onlineUpdateCycleConfigClass.newInstance();
            }
        } catch (Throwable t) {
            LogManager.w("xiaoyuan", "getOnlineUpdateCycleConfig error", t);
        }
        return mOnlineUpdateCycleConfig;
    }

    private static ParseVerifyCodeValidTimeInterfaceget getParseVerifyCodeValidTime(){
        try {
            Class parseVerifyCodeValidTimeClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseVerifyCodeValidTime");
            if (parseVerifyCodeValidTimeClass != null) {
                mParseVerifyCodeValidTime = (ParseVerifyCodeValidTimeInterfaceget) parseVerifyCodeValidTimeClass.newInstance();
            }
        } catch (Throwable t) {
            LogManager.w("xiaoyuan", "DexUtil getParseVerifyCodeValidTime：", t);
        }
        return mParseVerifyCodeValidTime;
    }
    
    public static JSONObject handerWatchValueMap(Map<String, Object> valueMap) {
        JSONObject newValueMap = null;
        try {
            if (DuoquUtils.getAidlAction().supportAidlAction()) {
                String response = DuoquUtils.getAidlAction().handerWatchValueMap(valueMap);
                if (response != null) {
                    newValueMap = new JSONObject(response);
                }
            }
            else{
                ParseWatchInterface lib = DexUtil.getParseWatchImpl(false);
                if (lib != null) {
                    LogManager.d("showPopuMessage", "ParseWatchInterface is not null");
                    newValueMap = lib.handerValueMap(valueMap);
                }
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "handerWatchValueMap: ", e);
        }
        return newValueMap;
    }

    public static JSONObject handerContactValueMap(Map<String, Object> valueMap) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().handerContactValueMap(valueMap);
        }
        JSONObject newValueMap = null;
        try {
            ParseContactInterface lib = DexUtil.getParseContactImpl(false);
            if (lib != null) {
                LogManager.d("showPopuMessage", "ParseContactInterface is not null");
                newValueMap = lib.handerValueMap(valueMap);
            } else {
                LogManager.d("showPopuMessage", "ParseContactInterface is null");
            }
        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "handerContactValueMap error ", e);

        }
        return newValueMap;

    }

    public static ParseWatchInterface getParseWatchImpl(boolean reload) {
        ParseWatchInterface parseWatch = null;
        try {
            Class parseWatchClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseWatch");
            if (parseWatchClass != null) {
                parseWatch = (ParseWatchInterface) parseWatchClass.newInstance();
            }

        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "getParseWatchImpl error: ", e);


        }
        return parseWatch;

    }
    
    public static JSONObject handerBoxValueMap(Map<String, Object> valueMap) {
        JSONObject newValueMap = null;
        try {
            if (DuoquUtils.getAidlAction().supportAidlAction()) {
                String response = DuoquUtils.getAidlAction().handerBoxValueMap(valueMap);
                if (response != null) {
                    newValueMap = new JSONObject(response);
                }
            }
            else{
                ParseBoxInterface lib = DexUtil.getParseBoxImpl(false);
                if (lib != null) {
                    LogManager.d("showPopuMessage", "ParseWatchInterface is not null");
                    newValueMap = lib.handerValueMap(valueMap);
                } else {
                    LogManager.d("showPopuMessage", "ParseWatchInterface is null");
                }   
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "handerWatchValueMap error:", e);
        }
        return newValueMap;
    }
    
    public static ParseBoxInterface getParseBoxImpl(boolean reload) {
        ParseBoxInterface parseBox = null;
        try {
            Class parseBoxClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseBox");
            if (parseBoxClass != null) {
                parseBox = (ParseBoxInterface) parseBoxClass.newInstance();
            }
        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "getParseBoxImpl error ", e);
        }
        return parseBox;

    }

    public static ParseContactInterface getParseContactImpl(boolean reload) {
        ParseContactInterface parseContact = null;
        try {
            Class parseWatchClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseContact");
            if (parseWatchClass != null) {
                parseContact = (ParseContactInterface) parseWatchClass.newInstance();
            }

        } catch (Throwable  e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "getParseContactImpl: ", e);


        }
        return parseContact;

    }

    public static CorpSignInterface getCorpSignImpl(boolean reload) {
        CorpSignInterface corpSign = null;
        try {
            Class corpSignClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.CorpSignImpl");
            if (corpSignClass != null) {
                corpSign = (CorpSignInterface) corpSignClass.newInstance();
            }

        } catch (Throwable e) {
//            exception.printStackTrace();
            LogManager.w(Constant.TAG, "getCorpSignImpl error: ", e);


        }
        return corpSign;

    }

    /* SDK-478 huangzhiqiang 20160623 start */
    /**
     * 获取企业签名及行业编码
     * 
     * @param msg
     * @return [企业签名,行业编码]
     */
    public static String[] getCorpAndEc(String msg) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getCorpAndEc(msg);
        }
        String[] corpAndEc = null;
        try {
            CorpSignInterface lib = DexUtil.getCorpSignImpl(false);
            if (lib != null) {
                corpAndEc = lib.getCorpAndEc(msg);
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "DexUtil getCorpAndEc error: ", e);
        }
        if (corpAndEc == null || corpAndEc.length < 2) {
            corpAndEc = new String[] { getCorp(msg), null };
        }
        return corpAndEc;
    }
    /* SDK-478 huangzhiqiang 20160623 end */

    /**
     * 获取企业签名
     * 
     * @param msg
     * @return
     */
    public static String getCorp(String msg) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getCorp(msg);
        }
        try {
            CorpSignInterface lib = DexUtil.getCorpSignImpl(false);
            if (lib != null) {
                return lib.getCorp(msg);
            } else {
                return CorpSignUtils.getCorp(msg);
            }
        } catch (Throwable e) {
            try {
                return CorpSignUtils.getCorp(msg);
            } catch (Throwable e2) {

            }
        }
        return "";
    }
    
    public static String catchUrls(String msg, String unionBy){
          if (DuoquUtils.getAidlAction().supportAidlAction()) {
              return DuoquUtils.getAidlAction().catchUrls(msg, unionBy);
          }
          String urls = null;
          try {
               Class ParseUtilUrlClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilUrl");
               if(ParseUtilUrlClass!=null){
                   Method method = ParseUtilUrlClass.getMethod("catchUrls",String.class, String.class);
                   urls = (String) method.invoke(ParseUtilUrlClass, msg, unionBy);
               }
               
          } catch (Throwable e) {
              LogManager.e("DexUtil",e.getMessage(),e);
          }
          /* SDK-398 huangzhiqiang 20160418 start */
          return urls == null ? "" : urls;
          /* SDK-398 huangzhiqiang 20160418 end */
    }

    public static IActionService getActionInterfaceImpl(boolean reload) {
        IActionService actionServiceImpl = null;
        try {
            Class actionServiceClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ActionServiceImpl");
            if (actionServiceClass != null) {
                actionServiceImpl = (IActionService) actionServiceClass.newInstance();
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "DexUtil getActionInterfaceImpl ", e);
        }
        return actionServiceImpl;

    }

    public static String getCmd(String phoneNum, String msg) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getCmd(phoneNum, msg);
        }
        String cmd = null;
        try {
            Class ParseUtilUnsubscribeClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilUnsubscribe");
            if (ParseUtilUnsubscribeClass != null) {
                Method method = ParseUtilUnsubscribeClass.getMethod("parseUnsubscribe", String.class, String.class);
                cmd = (String) method.invoke(ParseUtilUnsubscribeClass, phoneNum, msg);
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "ParseUtilUnsubscribe getCmd: ", e);
        }
        /* SDK-398 huangzhiqiang 20160418 start */
        return cmd == null ? "" : cmd;
        /* SDK-398 huangzhiqiang 20160418 end */
    }
    
    /* SDK-617 zhaojiangwei 20160912 start */
    /* SDK-583 zhaojiangwei 20160811 start */
    public static int parseSensitive(String message) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().parseSensitive(message);
        }
        String uuid = UUIDUtils.uniqId();
        int opRet = 0;
        try {
            ConversationManager.saveLogIn(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "parseSensitive",message);
            Class parseSensitiveClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseSensitiveUtil");
            if(parseSensitiveClass!=null) {
               Method method = parseSensitiveClass.getMethod("parseSensitive",String.class);
               opRet = (Integer)method.invoke(parseSensitiveClass,message);
            }
        } catch (Throwable e) {     
            LogManager.w(Constant.TAG, "parseSensitive: ", e);
        }finally{
            ConversationManager.saveLogOut(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "parseSensitive",message);
        }
        return opRet;
    }
    /* SDK-583 zhaojiangwei 20160811 end */
    /* SDK-617 zhaojiangwei 20160912 end */

    /*SDK-743 zhaojiangwei 20170407 start */ 
    public static boolean isUnSubMsg(String smsBody) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().isUnSubMsg(smsBody);
        }
        boolean opRet = false;
        try {
            Class parseClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilUnsubscribe");
            if (parseClass != null) {
                Method method = parseClass.getMethod("isUnSubMsg", String.class);
                opRet = (Boolean) method.invoke(parseClass, smsBody);
            }
        }
        catch (Throwable e) {
            LogManager.w(Constant.TAG, "isUnSubMsg: ", e);
        }
        return opRet;
    }
    /*SDK-743 zhaojiangwei 20170407 end */ 
    
    /* SDK-383 xusongzhou 20160414 start */
    public static String parseRecogniseValue(String phoneNum,String msg,long msgTime,Map extend) {
        /*SDK-431 songzhirong 20160530 start*/
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().parseRecogniseValue(phoneNum, msg, msgTime, extend);
        }
        String uuid = UUIDUtils.uniqId();
        String result = "";
        try {
            ConversationManager.saveLogIn(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "parseRecogniseValue",phoneNum,msg,msgTime,extend);
            /*SDK-431 songzhirong 20160530 end*/
             Class parseUtilMultipleClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilMultiple");
            if(parseUtilMultipleClass!=null) {
                /* SDK-409 hewengao 20160426 start */
               Method method = parseUtilMultipleClass.getMethod("multiParse",String.class,String.class,long.class,Map.class);
               result = (String)method.invoke(parseUtilMultipleClass,phoneNum, msg,msgTime,extend);
               return result;
                /* SDK-409hewengao 20160426 end */
            }
        } catch (Throwable e) {     
            LogManager.w(Constant.TAG, "multiParse: ", e);
        }finally{
            /*SDK-431 songzhirong 20160530 start*/
            ConversationManager.saveLogOut(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "parseRecogniseValue",phoneNum,msg,msgTime,extend,result);
            /*SDK-431 songzhirong 20160530 end*/
         
        }
        return null;
    }
    public static String getRecogniseActionConfig(JSONObject obj,Map<String, String> extend) {
        /*SDK-431 songzhirong 20160530 start*/
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getRecogniseActionConfig(obj, extend);
        }
        String uuid = UUIDUtils.uniqId();
        String result = "";
        try {
            ConversationManager.saveLogIn(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "getRecogniseActionConfig",obj,extend);
            /*SDK-431 songzhirong 20160530 end*/
            Class cfgClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.WizardServiceMenuData");
            if(cfgClass!=null) {
                /*SDK-409 hewengao 20160426 start*/
                Method method = cfgClass.getMethod("getRecogniseMenuAction",JSONObject.class,Map.class);
                result = (String)method.invoke(cfgClass, obj,extend);
                return result;
                /*SDK-409 hewengao 20160426 start*/
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "parseRecogniseValue: ", e);
        }finally{
            /*SDK-431 songzhirong 20160530 start*/
            ConversationManager.saveLogOut(uuid,"cn.com.xy.sms.sdk.dex.DexUtil", "getRecogniseActionConfig",obj,extend,result);
            /*SDK-431 songzhirong 20160530 end*/
        }
        return null;
    }
    /* SDK-383 xusongzhou 20160414 end */
     /**
      * 三星分类接口
      * @param orgValueMap
      * @return
      */
    public static JSONObject getSmsType(Map<String, Object> orgValueMap) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getSmsType(orgValueMap);
        }
        JSONObject result = null;
        try {
            Class parseUtilBubbleClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilBubble");
            if (parseUtilBubbleClass != null) {
                Method method = parseUtilBubbleClass.getMethod("getSmsType", Map.class);
                result = (JSONObject) method.invoke(parseUtilBubbleClass, orgValueMap);
                return result;
            }
        }
        catch (Throwable e) {
            LogManager.w(Constant.TAG, "getSmsType error: ", e);
        }
        return result;
    }

     /*SDK-381/songzhirong/2016.04.06---start---*/
     public static JSONArray parseMsgForCardArray(JSONObject jsobj,Map<String, String> extend){
        try {
            if (DuoquUtils.getAidlAction().supportAidlAction()) {
                JSONArray array = null;
                String response = DuoquUtils.getAidlAction().parseMsgForCardArray(jsobj, extend);
                if (response != null) {
                    array = new JSONArray(response);
                }
                return array;
            }
            else {
                Class parseUtilBubbleClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilBubble");
                if (parseUtilBubbleClass != null) {
                    Method method = parseUtilBubbleClass.getMethod("parseMsgForCardArray", JSONObject.class, Map.class);
                    return (JSONArray) method.invoke(parseUtilBubbleClass, jsobj, extend);
                }
            }
        }
        catch (Throwable e) {
            LogManager.w(Constant.TAG, "parseMsgForCardArray: error", e);
        }
        return null;
    }
     /*SDK-381/songzhirong/2016.04.06---end---*/

    /* SDK-517 huangzhiqiang 20160701 start */
    private static Object mOnlineUpdateCycleConfigInstance = null;

    private static Object getOnlineUpdateCycleConfigInstance(Class<?> cls) throws Throwable {
        Object instance = null;
        if (mOnlineUpdateCycleConfigInstance != null) {
            instance = mOnlineUpdateCycleConfigInstance;
        } else if (cls != null) {
            instance = cls.newInstance();
            mOnlineUpdateCycleConfigInstance = instance;
        }
        return instance;
    }

    private static void setOnlineUpdateCycleConfigInstance(Object obj) {
        mOnlineUpdateCycleConfigInstance = obj;
    }
    /* SDK-517 huangzhiqiang 20160701 end */

     /*SDK-392  hewengao 20160416 start*/
     /**
      * 根据类型 获取网络开关
      * @param type  
      * @return
      */
    public static boolean geOnOffByType(int type) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getOnOffByType(type);
        }
        try {
            Class onlineClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.OnlineUpdateCycleConfig");
            if (onlineClass != null) {
                KeyManager.initAppKey();
                /* SDK-517 huangzhiqiang 20160701 start */
                Object obj = getOnlineUpdateCycleConfigInstance(onlineClass);
                /* SDK-517 huangzhiqiang 20160701 end */
                Method method = onlineClass.getMethod("geOnOffByType", Integer.class, String.class);
                boolean res = (Boolean) method.invoke(obj, type, KeyManager.getAppKey());
                /* SDK-392 songzhirong 20160416 start */
                return res;
                /* SDK-392 songzhirong 20160416 start */
            }
        } catch (Throwable t) {
            LogManager.w("DexUtil", "DexUtil geOnOffByKey error", t);
        }
        return false;
    }
     /*SDK-392  hewengao 20160416 end*/
        
     public static Date convertDate(String dateString) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().convertDate(dateString);
        }
		Date date = null;
		try {
			ClassLoader dexClassLoader = getDexClassLoader();
			if (dexClassLoader != null) {
				Class cls = dexClassLoader.loadClass("cn.com.xy.sms.sdk.Iservice.DateTimeNormalizer");
				if (cls != null) {
					Method method = cls.getMethod("convertDate", String.class);
					date = (Date) method.invoke(cls, dateString);
				}
			}
		}
		catch (Throwable t) {
			LogManager.e("DexUtil", "DexUtil convertDate error：", t);
		}
		return date;
     }
     
     /* SDK-601 20160830 zhaojiangwei start */
     public static Date convertDate(String dateString, Date baseDate) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().convertDate(dateString, baseDate);
        }
 		Date date = null;
 		try {
 			ClassLoader dexClassLoader = getDexClassLoader();
 			if (dexClassLoader != null) {
 				Class cls = dexClassLoader.loadClass("cn.com.xy.sms.sdk.Iservice.DateTimeNormalizer");
 				if (cls != null) {
 					Method method = cls.getMethod("convertDate", String.class, Date.class, Boolean.class, Boolean.class);
 					date = (Date) method.invoke(cls, dateString, baseDate, true, false);
 				}
 			}
 		}
 		catch (Throwable t) {
 			LogManager.e("DexUtil", "DexUtil convertDate2 error：", t);
 		}
 		return date;
      }
     /* SDK-601 20160830 zhaojiangwei end */

    /* SDK-638/yangzhi/2016.10.11---start--- */
    public static long convertDateLong(String dateString, Date timeBase, boolean autoFill, boolean ignoreIfNoDate,
            boolean maxThanBaseTime) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().convertDateLong(dateString, timeBase, autoFill, ignoreIfNoDate, maxThanBaseTime);
        }
        long time = 0L;
        try {
            ClassLoader dexClassLoader = getDexClassLoader();
            if (dexClassLoader != null) {
                Class cls = dexClassLoader.loadClass("cn.com.xy.sms.sdk.Iservice.DateTimeNormalizer");
                if (cls != null) {
                    Method method = cls.getMethod("convertDateLong", String.class, Date.class, boolean.class,
                            boolean.class, boolean.class);
                    time = (Long) method.invoke(cls, dateString, timeBase, autoFill, ignoreIfNoDate, maxThanBaseTime);
                }
            }
        } catch (Throwable t) {
            LogManager.e("DexUtil", "DexUtil convertDateLong error：", t);
        }
        return time;
    }
    /* SDK-638/yangzhi/2016.10.11---end--- */

     /*SDK-425 lilong 20160510 start*/
     /*SDK-451/yangzhi/2016.05.23---start---*/
    public static JSONArray getConfigByType(int type, String uiversion, Integer suportMenuId) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getConfigByType(type, uiversion, suportMenuId);
        }
        try {
            Class onlineClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.OnlineUpdateCycleConfig");
            if (onlineClass != null) {
                KeyManager.initAppKey();
                
                /* SDK-517 huangzhiqiang 20160701 start */
                Object obj = getOnlineUpdateCycleConfigInstance(onlineClass);
                
                /* SDK-517 huangzhiqiang 20160701 end */
                Method method = onlineClass.getMethod("getConfigByType", Integer.class, String.class, String.class,
                        String.class, Integer.class);
                JSONArray data = (JSONArray) method.invoke(obj, type, KeyManager.getAppKey(), NetUtil.APPVERSION,
                        uiversion, suportMenuId);
                

                return data;
            }
        } catch (Throwable t) {
            LogManager.e("DexUtil", "DexUtil geOnOffByKey error" , t);
        }
        return null;
    }
     /*SDK-451/yangzhi/2016.05.23---end---*/
     /*SDK-425 lilong 20160510 end*/
    
    /*SDK-602 zhaojiangwei 20160912 start */
    public static String getOnLineConfigureData(int type) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getOnLineConfigureData(type);
        }
        try {
            Class onlineClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.OnlineUpdateCycleConfig");
            if (onlineClass != null) {
                Object obj = getOnlineUpdateCycleConfigInstance(onlineClass);
                Method method = onlineClass.getMethod("getConfigureString", Integer.class,Map.class);
                String data = (String) method.invoke(obj, type, null);
                return data;
            }
        }
        catch (Throwable t) {
            LogManager.e("DexUtil", "DexUtil getOnLineConfigureData error", t);
        }
        return null;
    }
    /*SDK-602 zhaojiangwei 20160912 end */

     
     /*SDK-382 /songzhirong/2016.05.17---start---*/
     public static void handleParseMsg(final Context ctx, final String msgId,final String phoneNumber, final String smsCenterNum,
             final String smsContent, final long smsTime, final Map<String, String> extend,final Map<String, Object> result){
             if (DuoquUtils.getAidlAction().supportAidlAction()) {
                 DuoquUtils.getAidlAction().handleParseMsg(msgId, phoneNumber, smsCenterNum, smsContent, smsTime, extend, result);
                 return;
             }
            try {
//              long start = System.currentTimeMillis();
                final JSONObject jsobj = JsonUtil.changeMapToJason(result); 
//              long end = System.currentTimeMillis();
//              Log.i("handleParseMsg", "time="+(end-start));

                if(jsobj==null) return;
                /*SDK-616 hewengao 20160912 start*/
                SmartSmsThreadPoolManager.dexUtilPool.execute(new Runnable() {
                /*SDK-616 hewengao 20160912 end*/
                    @Override
                    public void run() {
                        try {
                            Process.setThreadPriority(Process.THREAD_PRIORITY_LOWEST);
                            Class parseUtilConversationClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilConversation");
                            if (parseUtilConversationClass != null) {
                                  Method method = parseUtilConversationClass.getMethod("handleParseMsg",Context.class, String.class,String.class, String.class,
                                            String.class, long.class, Map.class,JSONObject.class);
                                  method.invoke(parseUtilConversationClass,  ctx, msgId, phoneNumber,  smsCenterNum,
                                         smsContent,  smsTime,  extend,jsobj);
                                  
                              
                            }  
//                          ParseUtilConversation.handleParseMsg(ctx, msgId,phoneNumber, smsCenterNum, smsContent, smsTime, extend, jsobj);
                        } catch (Throwable e) {
//                          e.printStackTrace();
                            LogManager.e(Constant.TAG, "handleParseMsg: error", e);
                        }
                        
                        
                    }
                });
                    
                    
            } catch (Throwable e) {
//              e.printStackTrace();
                LogManager.e(Constant.TAG, "handleParseMsg: error", e);
            }
     }
        
     
    public static JSONObject queryConversationMsg(Context ctx,
            String actionType, JSONObject data, Map extend) {
        try {

            
            Class parseUtilConversationClass = getClassBymap(null,
                    "cn.com.xy.sms.sdk.Iservice.ParseUtilConversationHelper");
            if (parseUtilConversationClass != null) {
                Method method = parseUtilConversationClass
                        .getMethod("queryConversationMsg", Context.class,String.class, JSONObject.class, Map.class);
                return (JSONObject) method.invoke(parseUtilConversationClass,ctx, actionType,data,extend);
            }
             
//          return ParseUtilConversationHelper.queryConversationMsg(ctx, actionType,
//                  data, extend);

        } catch (Throwable e) {
            LogManager.e(Constant.TAG,
                    "queryConversationMsg: error", e);

        }
        return null;
    }
      /*SDK-382 /songzhirong/2016.05.17---end---*/

    /* SDK-453/yangzhi/2016.05.23---start--- */
    public static String getUIVersion() {
        try {
            if (StringUtils.isNull(uiVersion)) {
                /* SDK-477/yangzhi/2016.06.07---start---*/
               
                /*SDK-481 hewengao 20160613 start */
                String UIConfigClass = DuoquUtils.getSdkDoAction().getConfig(AbsSdkDoAction.CONFIG_UI_CONFIG_CLASS, null);
                Class cls = Class.forName(UIConfigClass);
                //Class cls = Class.forName("cn.com.xy.sms.sdk.ui.config.UIConfig");
                /*SDK-481 hewengao 20160613 end */
                
                /* SDK-477/yangzhi/2016.06.07---end---*/
                Method m = cls.getMethod("getUIVersion");
                if (m != null) {
                    uiVersion = (String) m.invoke(cls);
                }
            }
        } catch (Throwable e) {
            // e.printStackTrace();
            uiVersion = "-1";
            LogManager.e(Constant.TAG, "getUIVersion: ", e);
        }
        return uiVersion;
    }
    /*SDK-453/yangzhi/2016.05.23---end---*/

    /*SDK-457 hewengao 20160525 start */
    public static void beforeInitBigJar(){
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return;
        }
        try{
            FileUtils.loadPUJarFile();
            /*SDK-475 hewengao 20160615 start */
             String clsArr0[] ={"ScenesScanner","ParseSimpleBubbleUtil","ParseNotification"};
             String clsName = "cn.com.xy.sms.sdk.Iservice.";
             for(String cls : clsArr0){
                 DexUtil.getClassBymap(null, clsName+cls);
             }
             for (int i =1; i <= 21; i++) {
                 DexUtil.getClassBymap(null, clsName+"PU"+ (i < 10 ? "0"+i:i));
             }
             /*SDK-475 hewengao 20160615 end */
             /*SDK-594 hewengao 20160615 start */
             DuoquUtils.getSdkDoAction().onEventCallback(AbsSdkDoAction.SDK_EVENT_LOAD_COMPLETE, null);
             /*SDK-594 hewengao 20160615 end */
             
             /*SDK-747 zhaojiangwei 20160330 start */
             JarSubCheckQueue.mSDKLoadCompleted = true;
             /*SDK-747 zhaojiangwei 20160330 end */
             
        }catch(Throwable e){
             LogManager.e(Constant.TAG, "beforeInitBigJar: ", e);
        }finally {
            /*SDK-673 hewengao 20161114 start*/
            InitUtil.isLoadedBigJar =true;
            /*SDK-673 hewengao 20161114 start*/
        }
    }
    /*SDK-457 hewengao 20160525 end */

     /* SDK-421 huangzhiqiang 20160525 start */
     /**
      * 短信原文去敏
      * 
      * @param msg 短信原文
      * @return
      */
    public static String multiReplace(String msg) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().multiReplace(msg);
        }
        try {
            Class<?> parseUtilMultipleClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilMultiple");
            if (parseUtilMultipleClass != null) {
                Method method = parseUtilMultipleClass.getMethod("multiReplace", String.class);
                return (String) method.invoke(parseUtilMultipleClass, msg);
            }
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "DexUtil multiReplace: ", e);
        }
        return null;
    }

    /**
     * 分片数据识别
     * 
     * @param msg 去敏后的短信原文
     * @param msgIdx 分组小标
     * @param msgMd 模数
     * @return index0:需要上传的字符序列  index1:短信是否结束标示  null:分片失败
     */
    public static String[] parseShard(String msg, String msgIdx, String msgMd) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().parseShard(msg, msgIdx, msgMd);
        }
        try {
            Class<?> parseUtilMultipleClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilMultiple");
            if (parseUtilMultipleClass != null) {
                Method method = parseUtilMultipleClass.getMethod("check", String.class, String.class, String.class);
                return (String[]) method.invoke(parseUtilMultipleClass, msg, msgIdx, msgMd);
            }
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "DexUtil parseShard: ", e);
        }
        return null;
    }
     /* SDK-421 huangzhiqiang 20160525 end */
    
    /*SDK-431  /songzhirong/2016.05.23---start---*/
    public static void saveLogIn(final String uuid,final String className, final String methodName, final Object... args) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            DuoquUtils.getAidlAction().saveLogIn(uuid, className, methodName, args);
            return;
        }
        try { 
            /*SDK-616 hewengao 20160912 start*/
            SmartSmsThreadPoolManager.dexUtilPool.execute(new Runnable() {
            /*SDK-616 hewengao 20160912 start*/
                @Override
                public void run() {
                    try {
                        Class cls = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.LogService");
                        if (cls != null) {
                            Method method = cls.getMethod("saveLogIn",String.class, String.class, String.class, Object[].class);
                            method.invoke(cls, uuid,className, methodName, handlerParamsToJSONObjectIfNeed(args));
                        }
//                         LogService.saveLogIn(uuid,className, methodName, args);

                    } catch (Throwable e) {
                        // TODO: handle exception
                    }
                    
                }
            });
          
            // LogService.saveLogIn(className, methodName, args);
        } catch (Throwable t) {
            LogManager.e("DexUtil", "DexUtil saveLogIn：", t);
        }
    }

    public static void saveLogOut(final String uuid,final String className, final String methodName, final Object... args) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            DuoquUtils.getAidlAction().saveLogOut(uuid, className, methodName, args);
            return;
        }
        try {
            /*SDK-616 hewengao 20160912 start*/
            SmartSmsThreadPoolManager.dexUtilPool.execute(new Runnable() {
            /*SDK-616 hewengao 20160912 end*/
                @Override
                public void run() {
                   try {
                       Class cls = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.LogService");
                       if (cls != null) {
                           Method method = cls.getMethod("saveLogOut", String.class,String.class, String.class, Object[].class);
                           method.invoke(cls, uuid,className, methodName, handlerParamsToJSONObjectIfNeed(args));
                       }
//                     LogService.saveLogOut(uuid,className, methodName, args);

                   } catch (Throwable e) {
                    // TODO: handle exception
                   }
                    
                }
            });
           
            // LogService.saveLogOut(className, methodName, args);
        } catch (Throwable t) {
            LogManager.e("DexUtil", "DexUtil saveLogOut：", t);
        }
    }
    
    /* SDK-584 zhaojiangwei 20160905 start */
    public static void saveExceptionLog(final Throwable ecx) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            DuoquUtils.getAidlAction().saveLogException("", "", ecx);
            return;
        }
        try {
            /* SDK-616 hewengao 20160912 start */
            SmartSmsThreadPoolManager.dexUtilPool.execute(new Runnable() {
                /* SDK-616 hewengao 20160912 start */
                @Override
				public void run() {
					try {
						String className = "";
						String methordName = "";
						StackTraceElement[] stackTrace = ecx.getStackTrace();
						if (stackTrace!=null && stackTrace.length>0) {
							className = stackTrace[0].getClassName();
							methordName = stackTrace[0].getMethodName();
						}
						Class cls = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.LogService");
						if (cls != null) {
							Method method = cls.getMethod("saveLogException", String.class, String.class,
									Throwable.class);
							method.invoke(cls, className, methordName, ecx);
						}
					}
					catch (Throwable e) {
						LogManager.e("DexUtil", "DexUtil execute：", e);
					}
				}
			});
		}
		catch (Throwable e) {
			// TODO: handle exception
			LogManager.e("DexUtil", "DexUtil saveExceptionLog：", e);
		}
	}
	/* SDK-584 zhaojiangwei 20160905 end */

    /* SDK-515 huangzhiqiang 20160629 start */
    /**
     * 处理方法参数，将不是java原生类型的参数转换为JSONObject对象
     * 
     * @param params
     * @return
     */
    public static Object[] handlerParamsToJSONObjectIfNeed(Object[] params) {
        if (params == null || params.length == 0) {
            return null;
        }
        try {
            for (int i = 0; i < params.length; i++) {
                Object param = params[i];
                if (param == null) {
                    continue;
                }
                if (param instanceof XyCallBack || param instanceof Context
                        || param.getClass().getName().startsWith("android.")) {
                    params[i] = new JSONObject().put("objectToJson", true).put("className", param.getClass().getName());
                } else if (param.getClass().getName().startsWith("cn.com.xy.sms")) {
                    JSONObject objJson = JsonUtil.parseObjectToJson(param);
                    if (objJson != null) {
                        params[i] = objJson;
                    }
                }
            }
        } catch (Throwable e) {
            LogManager.e("DexUtil", "DexUtil handlerParamsToJSONObjectIfNeed：", e);
        }
        return params;
    }
    /* SDK-515 huangzhiqiang 20160629 end */

   public static void insertLog(String tableName,String sql,JSONObject valuesObject){  
       if (DuoquUtils.getAidlAction().supportAidlAction()) {
           DuoquUtils.getAidlAction().insertLog(tableName, sql, valuesObject);
           return;
       }
       try {
           Class cls = getClassBymap(null,"cn.com.xy.sms.sdk.Iservice.LogService");
           if (cls != null) {
               Method method = cls.getMethod("insert", String.class,String.class,JSONObject.class);
               method.invoke(cls,tableName, sql,valuesObject);
           }         
//         LogService.insert(tableName, sql, valuesObject);
       } catch (Throwable t) {
           LogManager.e("DexUtil", "DexUtil saveLogOut：", t);
       }       
   }
   
   public static void deleteLog(String tableName,String sql,JSONObject whereArgs){
       if (DuoquUtils.getAidlAction().supportAidlAction()) {
           DuoquUtils.getAidlAction().deleteLog(tableName, sql, whereArgs);
           return;
       }
       try {
           Class cls = getClassBymap(null,"cn.com.xy.sms.sdk.Iservice.LogService");
           if (cls != null) {
               Method method = cls.getMethod("delete", String.class,String.class,JSONObject.class);
               method.invoke(cls,tableName, sql,whereArgs);
           }           
//         LogService.delete(tableName, sql, whereArgs);
       } catch (Throwable t) {
           LogManager.e("DexUtil", "DexUtil saveLogOut：", t);
       }   
       
   }
   
   public static JSONArray queryLog(String tableName,
           String sql,String[] columns, JSONObject whereArgs,String orderBy, String limit){
       if (DuoquUtils.getAidlAction().supportAidlAction()) {
           return DuoquUtils.getAidlAction().queryLog(tableName, sql, columns, whereArgs, orderBy, limit);
       } 
       try {
           Class cls = getClassBymap(null,"cn.com.xy.sms.sdk.Iservice.LogService");
           if (cls != null) {
               Method method = cls.getMethod("query", String.class,String.class,String[].class,
                       JSONObject.class,String.class,String.class);
               return (JSONArray)method.invoke(cls, tableName, 
                        sql, columns,whereArgs, orderBy,  limit);
           }          
//         return LogService.query(tableName,  sql, columns, whereArgs, orderBy, limit);
       } catch (Throwable t) {
           LogManager.e("DexUtil", "DexUtil saveLogOut：", t);
       }   
       return null;
   }
    
   
   public static String queryLog(Integer type,String channel,String appVersion){
       if (DuoquUtils.getAidlAction().supportAidlAction()) {
           return DuoquUtils.getAidlAction().queryLogByType(type, channel, appVersion);
       }
       try {
         Class cls = getClassBymap(null,"cn.com.xy.sms.sdk.Iservice.LogService");
           if (cls != null) {
               Method method = cls.getMethod("queryLog", Integer.class,String.class,String.class);
               return (String)method.invoke(cls, type,channel, appVersion);
           }   
//           return LogService.queryLog(type, channel,appVersion);//     
       } catch (Throwable t) {
           LogManager.e("DexUtil", "DexUtil queryLog：", t);
       }   
       return "";
   }
   
   public static void postCallback(Integer type,String postData){
       if (DuoquUtils.getAidlAction().supportAidlAction()) {
           DuoquUtils.getAidlAction().postLogCallback(type, postData);
           return;
       }
       try {
               Class cls = getClassBymap(null,"cn.com.xy.sms.sdk.Iservice.LogService");
               if (cls != null) {
                   Method method = cls.getMethod("postCallback", Integer.class,String.class);
                   method.invoke(cls, type,postData);
               }
//               LogService.postCallback(type, postData);
           } catch (Throwable t) {
               LogManager.e("DexUtil", "DexUtil postCallback：", t);
           }   
           
   }
 
   /*SDK-431  /songzhirong/2016.05.23---end---*/

    /* SDK-428 huangzhiqiang 20160603 start */
    /**
     * 判断号码是否固话号码
     * 
     * @param phoneNumber
     * @return
     */
    public static boolean isNoAreaCodeFixedPhone(String phoneNumber) {
        try {
            Class<?> onlineClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.OnlineUpdateCycleConfig");
            if (onlineClass != null) {
                Method method = onlineClass.getMethod("isNoAreaCodeFixedPhone", String.class);
                return (Boolean) method.invoke(onlineClass, phoneNumber);
            }
        } catch (Throwable t) {
            LogManager.e(Constant.TAG, "DexUtil isNoAreaCodeFixedPhone error:", t);
        }
        if (!StringUtils.isNull(phoneNumber) && (phoneNumber.length() == 7 || phoneNumber.length() == 8)) {
            return true;
        }
        return false;
    }

    /**
     * 根据号码数据来源编号获取数据来源名称
     * 
     * @param sourceCode 数据来源编号
     * @return
     */
    public static String getNumberSourceName(String sourceCode) {
        String sourceName = null;
        try {
            Class<?> onlineClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.OnlineUpdateCycleConfig");
            if (onlineClass != null) {
                Method method = onlineClass.getMethod("getNumberSourceName", String.class);
                sourceName = (String) method.invoke(onlineClass, sourceCode);
            }
        } catch (Throwable t) {
            LogManager.e(Constant.TAG, "DexUtil getNumberSourceName error:", t);
        }
        if (StringUtils.isNull(sourceName)) {
            sourceName = getDefaultNumberSourceName(sourceCode);
        }
        return sourceName;
    }

    /**
     * 获取默认的号码数据来源名称
     * 
     * @param sourceCode 数据来源编号
     * @return
     */
    private static String getDefaultNumberSourceName(String sourceCode) {
        if (ChannelType.Qihu.toString().equals(sourceCode)) {
            return "360";
        }
        if (ChannelType.DHB.toString().equals(sourceCode)) {
            return "电话邦";
        }
        if (ChannelType.Sogou.toString().equals(sourceCode)) {
            return "搜狗";
        }
        if (ChannelType.ChuBao.toString().equals(sourceCode)) {
            return "触宝";
        }
        return "号码联盟";
    }
    /* SDK-428 huangzhiqiang 20160603 end */
    
    /* KINGMAIL-2  /songzhirong/20160603---start---*/    
    public static Map<String, Object> parseEmail(String fromUser, String content, Map<String, String> extend) {
		Map<String, Object> newValueMap = null;
		String uuid = UUIDUtils.uniqId();
		try {
			/* SDK-611 zhaojiangwei 20160906 start */
			ConversationManager.saveLogIn(uuid, "cn.com.xy.sms.sdk.dex.DexUtil", "parseEmail", fromUser, content, extend);
			/* SDK-611 zhaojiangwei 20160906 end */
			boolean isInitData = ParseItemManager.isInitData();
			if (isInitData) {
				Class<?> parseUtilEmailClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilEmail");
				if (parseUtilEmailClass != null) {
					Method method = parseUtilEmailClass.getMethod("parseEmail", String.class, String.class, Map.class);
					Map tempMap = (Map) method.invoke(parseUtilEmailClass, fromUser, content, extend);
					if (tempMap != null) {
						Class<?> parseUtilEmailMappingClass = getClassBymap(null,
								"cn.com.xy.sms.sdk.Iservice.ParseUtilEmailMapping");
						if (parseUtilEmailMappingClass != null) {
							Method method2 = parseUtilEmailMappingClass.getMethod("handerValueMap", Map.class);
							newValueMap = (Map) method2.invoke(parseUtilEmailMappingClass, tempMap);
						}
					}
				}
			}
			else {
				newValueMap = new HashMap<String, Object>();
				newValueMap.put("parseStatu", -1);
			}
		}
		catch (Throwable e) {
			LogManager.e("parseEmail", "DexUtil parseShard: ", e);
		}
		finally {
			/* SDK-611 zhaojiangwei 20160906 start */
			ConversationManager.saveLogOut(uuid, "cn.com.xy.sms.sdk.dex.DexUtil", "parseEmail", fromUser, content, extend, newValueMap);
			/* SDK-611 zhaojiangwei 20160906 end */
		}
		return newValueMap;
    }
    /* KINGMAIL-2  /songzhirong/20160603---end---*/    
    
    /*  SDK-505 /songzhirong/20160627---start--- */
    public static boolean init(Set<String> cts){
        try {
            Class<?> parseUtilEmailClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilEmail");
            if (parseUtilEmailClass != null) {
                Method method = parseUtilEmailClass.getMethod("init", Set.class);
                return (Boolean) method.invoke(parseUtilEmailClass, cts);              
            }
        } catch (Throwable e) {
            LogManager.w("init", "DexUtil init: ", e);

        }
        return false;
    }
    /*  SDK-505 /songzhirong/20160627---end--- */

    /* SDK-571 huangzhiqiang 20160729 start */
    public static boolean isEnterpriseEmail(String fromUser, Map<String, Object> extend) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().isEnterpriseEmail(fromUser, extend);
        }
        try {
            return (Boolean) methodInvoke("cn.com.xy.sms.sdk.Iservice.ParseUtilEmail", "canRec",
                    new Class<?>[] { String.class, Map.class }, new Object[] { fromUser, extend });
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "DexUtil isEnterpriseEmail error", e);
        }
        return false;
    }

    public static Object methodInvoke(String className, String methodName, Class<?>[] parameterTypes, Object[] args)
            throws Throwable {
        Object result = null;
        Class<?> receiver = getClassBymap(null, className);
        if (receiver != null) {
            Method method = receiver.getMethod(methodName, parameterTypes);
            return method.invoke(receiver, args);
        }
        return result;
    }
    /* SDK-571 huangzhiqiang 20160729 end */
    
    /*SDK-644 zhaojiangwei 20161018 start start */
    public static Map<String, Object> parseVerCode(String fromUser, String content, String subject, Map<String, String> extend){
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().parseVerCode(fromUser, content, subject, extend);
        }
        Map<String, Object> newValueMap = null;
        String uuid = UUIDUtils.uniqId();
        try {
            ConversationManager.saveLogIn(uuid, "cn.com.xy.sms.sdk.dex.DexUtil", "parseVerCode", fromUser, content, subject, extend);
            
            boolean isInitData = ParseItemManager.isInitData();
            if (isInitData) {
                Class<?> parseUtilEmailClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilEmail");
                if (parseUtilEmailClass != null) {
                    Method method = parseUtilEmailClass.getMethod("parseVerCode", String.class, String.class, String.class, Map.class);
                    newValueMap = (Map<String, Object>) method.invoke(parseUtilEmailClass, fromUser, content, subject,  extend);
                }
            }
            else {
                newValueMap = new HashMap<String, Object>();
                newValueMap.put("parseStatu", -1);
            }
        }
        catch (Throwable e) {
            LogManager.e("parseEmail", "DexUtil parseShard: ", e);
        }
        finally {
            ConversationManager.saveLogOut(uuid, "cn.com.xy.sms.sdk.dex.DexUtil", "parseVerCode", fromUser, content, subject, extend, newValueMap);
        }
        return newValueMap;
    }
    
    public static boolean isVCEmail(String subject, String summary, String fromUser, String xmailer,
            Map<String, String> extend) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().isVCEmail(subject, summary, fromUser, xmailer, extend);
        }
        try {
            return (Boolean) methodInvoke("cn.com.xy.sms.sdk.Iservice.ParseUtilEmail", "isVCEmail",
                    new Class<?>[] { String.class, String.class, String.class, String.class, Map.class },
                    new Object[] { subject, summary, fromUser, xmailer, extend });
        }
        catch (Throwable e) {
            LogManager.e(Constant.TAG, "DexUtil isEnterpriseEmail error", e);
        }
        return false;
    }

    public static boolean isVCEmail(String subject) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().isVCEmail(subject);
        }
        try {
            return (Boolean) methodInvoke("cn.com.xy.sms.sdk.Iservice.ParseUtilEmail", "isVCEmail",
                    new Class<?>[] { String.class }, new Object[] { subject });
        }
        catch (Throwable e) {
            LogManager.e(Constant.TAG, "DexUtil isEnterpriseEmail error", e);
        }
        return false;
    }
    /*SDK-644 zhaojiangwei 20161018 start end */

    /* SMARTISAN-65 huangzhiqiang 20160630 start */
    public static void putActionDataToDataSource(JSONObject dataSource, Map<String, Object> baseParseResult,
            Map<String, Object> extend) {
        try {
            if (dataSource == null || baseParseResult == null || !baseParseResult.containsKey("NEW_ADACTION")) {
                return;
            }
            Class<?> cls = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.WizardServiceMenuData");
            if (cls != null) {
                Method method = cls.getMethod("putActionDataToDataSource", JSONObject.class,
                        Map.class, Map.class);
                method.invoke(cls, dataSource, baseParseResult, extend);
            } else {
                localPutActionDataToDataSource(dataSource, baseParseResult, extend);
            }
        } catch (Throwable t) {
            localPutActionDataToDataSource(dataSource, baseParseResult, extend);
            LogManager.w(Constant.TAG, "DexUtil putActionDataToDataSource error:", t);
        }
    }

    private static void localPutActionDataToDataSource(JSONObject dataSource, Map<String, Object> baseParseResult,
            Map<String, Object> extend) {
        try {
            dataSource.put("NEW_ADACTION", baseParseResult.get("NEW_ADACTION"));
        } catch (Throwable t) {
            LogManager.w(Constant.TAG, "DexUtil localPutActionDataToDataSource error:", t);
        }
    }
    /* SMARTISAN-65 huangzhiqiang 20160630 end */
    /*SDK-618  songzhirong 20160913 start*/
    /**
     * 清除脚本算法缓存
     */
    public static void cleanCache(){
        try {
            Class<?> parseUtilEmailClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.ParseUtilEmail");
            if (parseUtilEmailClass != null) {
                Method method = parseUtilEmailClass.getMethod("cleanCache");
                method.invoke(parseUtilEmailClass);          
            }
        } catch (Throwable e) {
            LogManager.w(Constant.TAG, "DexUtil cleanCache: ", e);

        }
    }
    /*SDK-618  songzhirong 20160913 end*/
	/*SDK-639 likuangkuang 20161012 start*/
    /**
     * 获取标记号对应标记名称MAP
     * 
     * @return 标记号对应标记名称MAP
     */
    public static Map<String, String> getNumberTagTypeMap(Map<String, Object> extend) {
        Map<String, String> numberTagTypeMap = null;
        try {
            Class<?> onlineClass = getClassBymap(null, "cn.com.xy.sms.sdk.Iservice.OnlineUpdateCycleConfig");
            if (onlineClass != null) {
                Method method = onlineClass.getMethod("getNumberTagTypeMap", Map.class);
                numberTagTypeMap = (Map<String, String>) method.invoke(onlineClass, extend);
            }
        } catch (Throwable t) {
            LogManager.e(Constant.TAG, "DexUtil getNumberTagTypeMap error:", t);
        }
        if (numberTagTypeMap == null) {
            numberTagTypeMap = getDefaultNumberTagTypeMap(extend);
        }
        return numberTagTypeMap;
    }
	
    /**
     * 获取默认的标记号对应标记名称MAP
     * 
     * @return 默认的标记号对应标记名称MAP
     */
    private static Map<String, String> getDefaultNumberTagTypeMap(Map<String, Object> extend) {
        Map<String, String> defaultNumberTagTypeMap = new HashMap<String, String>();
        defaultNumberTagTypeMap.put("1", "骚扰电话");
        defaultNumberTagTypeMap.put("2", "快递外卖");
        defaultNumberTagTypeMap.put("3", "疑似诈骗");
        defaultNumberTagTypeMap.put("4", "广告推销");
        defaultNumberTagTypeMap.put("5", "房产中介");
        defaultNumberTagTypeMap.put("6", "车辆服务");
        defaultNumberTagTypeMap.put("7", "保险理财");
        defaultNumberTagTypeMap.put("8", "招聘猎头");
        defaultNumberTagTypeMap.put("9", "响一声");
        defaultNumberTagTypeMap.put("10", "装修维修");
        defaultNumberTagTypeMap.put("11", "违法犯罪");
        defaultNumberTagTypeMap.put("12", "教育培训");
        defaultNumberTagTypeMap.put("13", "企业电话");
        defaultNumberTagTypeMap.put("14", "客服电话");
        return defaultNumberTagTypeMap;
    }
	/*SDK-639 likuangkuang 20161012 end*/

    /* SMARTISAN-565 huangzhiqiang 20170413 start */
    /**
     * 识别短信是否是工资类短信，如果是则返回JSON数据字符串，里面包含有工资类短信的金额下标；
     * 
     * @param msg 短信原文
     * @return 
     *         非工资短信返回："{\"salaryScene\": false }" 
     *         是工资短信返回："{\"indexs\": [ {\"startIndex\":40, \"endIndex\":47 },{\"startIndex\":53, \"endIndex\":60 }], \"salaryScene\": true }"
     */
    public static String parseSalary(String msg) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().parseSalary(msg);
        }
        try {
            return (String) methodInvoke("cn.com.xy.sms.sdk.Iservice.ParseUtilSalary", "parseSalary",
                    new Class<?>[] { String.class }, new Object[] { msg });
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "DexUtil parseSalary error", e);
        }
        return null;
    }
    /* SMARTISAN-565 huangzhiqiang 20170413 end */

    /* SDK-766 huangzhiqiang 20170419 start */
    /**
     * 识别短信内容是否存在退订信息，如果存在则返回JSONArray数据字符串，数据包含退订指令或退订号码(instruct)、动作类型(actionType 1:短信回复类的退订、2:电话类的退订)、退订内容下标(startIndex,endIndex)
     * 
     * @param msg
     * @return
     *         不存在退订信息返回："[]"
     *         存在退订信息返回："[{\"instruct\":\"95582\",\"actionType\":2,\"startIndex\":0,\"endIndex\":9},{\"instruct\":\"N\",\"actionType\":1,\"startIndex\":74,\"endIndex\":79} ]"
     */
    public static String parseUnsubscribe(String msg) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().parseUnsubscribe(msg);
        }
        try {
            return (String) methodInvoke("cn.com.xy.sms.sdk.Iservice.ParseUtilUnsubscribe", "parseUnsubscribe",
                    new Class<?>[] { String.class }, new Object[] { msg });
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "DexUtil parseUnsubscribe error", e);
        }
        return null;
    }
    /* SDK-766 huangzhiqiang 20170419 end */

    /* KINGMAIL-85 huangzhiqiang 20170424 start */
    /**
     * 根据邮箱地址获取对应情景id
     * 
     * @param address 邮箱地址
     * @param extend 扩展参数，可以为null
     * @return
     */
    public static String[] getAllowScenes(String address, Map<String, Object> extend) {
        if (DuoquUtils.getAidlAction().supportAidlAction()) {
            return DuoquUtils.getAidlAction().getAllowScenes(address, extend);
        }
        try {
            return (String[]) methodInvoke("cn.com.xy.sms.sdk.Iservice.ParseUtilEmail", "getAllowScenes",
                    new Class<?>[] { String.class, Map.class }, new Object[] { address, extend });
        } catch (Throwable e) {
            LogManager.e(Constant.TAG, "DexUtil getAllowScenes error", e);
        }
        return null;
    }
    /* KINGMAIL-85 huangzhiqiang 20170424 end */
}
